import { Button, Result } from 'antd';
import { useNavigate } from 'react-router-dom';

function Error401() {
  const navigate = useNavigate();
  
  return (
    <div style={{
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center',
      minHeight: '100vh',
      backgroundColor: '#f0f2f5'
    }}>
      <Result
        status="403"
        title="401"
        subTitle="抱歉，您无权访问此页面"
        extra={
          <div style={{ display: 'flex', gap: '16px', justifyContent:'center' }}>
            <Button type="primary" onClick={() => navigate(-2)}>
              返回上一页
            </Button>
            <Button onClick={() => navigate('/home')}>
              返回首页
            </Button>
          </div>
        }
      />
    </div>
  );
}
export default Error401;